#include <functional>
#include <iostream>
#include <utility>  // For std::forward

void example_function(int a, double b, const std::string& c) {
    std::cout << "example_function called with values: "
              << a << ", " << b << ", " << c << std::endl;
}

template<typename... Args>
auto bind_front_example_function(Args&&... args) {
    return std::bind_front(example_function, std::forward<Args>(args)...);
}
//g++ UsingBindFront.cpp --std=c++20 -o UsingBindFront
int main() {
    int a = 42;
    double b = 3.14159;
    std::string c = "Hello World";

    auto bound_function = bind_front_example_function(a, b);

    bound_function(c); // 等效于调用 example_function(42, 3.14159, "Hello World")
    
    return 0;
}